﻿using System;
using System.Windows.Forms;

namespace Aeon.Testing
{

static class Program
    {
    
    [STAThread]    
    /// <summary>
    /// The main entry point for the application.
    /// 
    /// </summary>
    static void Main()
        {
        try {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            
            Application.Run(new WindowMenu());
            }

        catch(Exception err)
            {
            String error = "[" + err.GetType().ToString()+ "]\r\n   " + err.Message + "\r\n\r\n";

            if (err.InnerException != null)
                {
                err = err.InnerException;
                error += "[" + err.GetType().ToString()+ "]\r\n   " + err.Message + "\r\n\r\n";
                }

            String stack = "[Call Stack Signatures]\r\n";
            String[] str = (err.StackTrace+"\r\n").Split('\r');
            foreach (string s in str) stack += (s.Contains(" in ")) ? (s.Substring(0,s.IndexOf(" in "))):(s);

            MessageBox.Show(error+stack,"Ooops...",MessageBoxButtons.OK,MessageBoxIcon.Error);
            }
        }
        
    }
    
    
}
